﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Mogre;
using MogreNewt;

namespace WastedMechanics
{
    public abstract class SelectableObject : GameObject
    {
        public abstract String DisplayName
        {
            get;
            set;
        }
        public abstract String Description
        {
            get;
            set;
        }
        public abstract Vector3 DisplayNameOffset
        {
            get;
            set;
        }

        public bool ShowName;
        
        public TalkReactions TalkResponse;

        public SelectableObject Interlocutor;
        public event Action<SelectableObject, SelectableObject> OnBeginConversation;
        public event Action<SelectableObject, SelectableObject> OnEndConversation;

        public virtual void BeginConversation(SelectableObject interlocutor)
        {
            Interlocutor = interlocutor;            
            if (OnBeginConversation != null) OnBeginConversation(this, Interlocutor);            
        }

        public virtual void EndConversation()
        {
            if (Interlocutor != null)                            
                if (OnEndConversation != null) OnEndConversation(this, Interlocutor);            
            Interlocutor = null;
        }        
    }
}
    